//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#ifndef _BindingInfo_h__
#define	_BindingInfo_h__
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include "CathCDDF.h"
#include "LigandNearResidues.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
struct LigandDomainNumber {

  String* name;
  int     number;

  LigandDomainNumber () {
    this->name   = new String ();
    this->number = 0;
  }

  LigandDomainNumber (String* name, int number) {
    this->name   = new String (name);
    this->number = number;
  }

  ~LigandDomainNumber () {
    if (this->name) delete this->name;
  }

  LigandDomainNumber operator= (const LigandDomainNumber& ligandDomainNumber) {

    this->name->In(ligandDomainNumber.name);
    this->number = ligandDomainNumber.number;
    
    return *this;

  }

};

typedef struct LigandDomainNumber LigandDomainNumber;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
class BindingInfo {
  
  private:
    
    String*                       domain;
    String*                       format;
    String*                       cathCode;
    
    TListE <SegmentCDDF>*         segments;   
    
    TListE <LigandNearResidues>*  nearResiduesByLigand;
    
    String*                       toString;
    
  protected:
    
    void                          CleanData (void);
    
  public:
    
    BindingInfo ();
    BindingInfo (const BindingInfo&);
    BindingInfo (const BindingInfo*);
    
    ~BindingInfo ();

    void                          Domain (String*);
    void                          Format (String*);
    void                          CathCode (String*);
    void                          Segments (TListE <SegmentCDDF>*);   
    void                          NearResiduesByLigand (TListE <LigandNearResidues>*);
    
    String*                       Domain (void);
    String*                       Format (void);
    String*                       CathCode (void);
    TListE <SegmentCDDF>*         Segments (void);
    TListE <LigandNearResidues>*  NearResiduesByLigand (void);
    
    bool                          ReadFromString (String*);
    bool                          ReadFromString (char*);
    
    bool                          DeleteResiduesAppearAsLigand (TListE <String>*);
    bool                          DeleteLigandsAppearInList (TListE <String>*);
    bool                          HasAtLeastOneLigandInList (TListE <LigandDomainNumber>*);
    bool                          HasALigandName (LigandDomainNumber*);
    
    String*                       ToString (void);
    String*                       ToStringForLigand (LigandDomainNumber*);
    String*                       ToStringForLigands (TListE <LigandDomainNumber>*);
    String*                       ToStringSegment (void);
    String*                       ToStringHeader (void);
    
    BindingInfo                   operator= (const BindingInfo&);
    
};
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#endif
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
